package com.bub.pay.framework.common.async;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component(value = "asyncProperties")
@ConfigurationProperties(prefix = "async-config", ignoreUnknownFields = false)
public class AsyncProperties {

    /**
     * 核心线程数量
     */
    private int corePoolSize = 2;
    /**
     * 线程池最大数量
     */
    private int maxPoolSize = 10;
    /**
     * 队列容量
     */
    private int queueCapacity = 100;
    /**
     * 线程名称前缀
     */
    private String threadNamePrefix = "bub-pay-framework-Executor-";

    public int getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public void setMaxPoolSize(int maxPoolSize) {
        this.maxPoolSize = maxPoolSize;
    }

    public int getQueueCapacity() {
        return queueCapacity;
    }

    public void setQueueCapacity(int queueCapacity) {
        this.queueCapacity = queueCapacity;
    }

    public String getThreadNamePrefix() {
        return threadNamePrefix;
    }

    public void setThreadNamePrefix(String threadNamePrefix) {
        this.threadNamePrefix = threadNamePrefix;
    }

}